<?php
header("Content-type:text/html; charset=utf-8;");
require('ppf/fun.php');
require("ppf/pdo_template.php");
require("ppf/pdo_mysql.php"); 

session_start();   
$qname=isset($_GET["t"])?$_GET["t"]:"index"; 
if(!isset($_SESSION['uid'])){
    $qname="login";
}
$qnamearr = explode('_', $qname);
$T=new pdo_template('',true,"utf8");
$template='';
if(file_exists("./BL/".$qnamearr[0]."/".$qname.".php")){
    $template = $qnamearr[0];
    include "./BL/".$template."/".$qname.".php";
}elseif(file_exists("./BL/common/".$qname.".php")){
    $template = 'common';
    include "./BL/".$template."/".$qname.".php";     
}else{
    die("Not BLL");
}

$T->close();  	
unset($T); 

